package com.swss.g.assets.action;

import com.swss.g.assets.bean.Asset;
import com.swss.g.assets.bean.AstRange;
import com.swss.g.assets.service.AssetCarService;
import com.swss.g.user.bean.User;
import com.swss.util.Pagination;

public class FinanceCarAction extends financeAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4442793994892653265L;

	/**
	 * service
	 */
	protected AssetCarService assetCarService;
	/**
	 * bean
	 */
	private AstRange astRange;
	/**
	 * 未审数据查询
	 * 
	 * @param deptNo
	 *            单位编号 chargeOffDeptList 拟核销财务科室
	 * @return resFinAduit
	 */
	@SuppressWarnings("unchecked")
	public String findNotAduit() throws Exception {
		String deptNo = this.getSessionAttr("user", User.class).getDeptNo().trim();
		chargeOffDeptList = this.getSysService().getChargeOffDept();
		if (this.msg != null) {
			this.msg = new String(msg.getBytes("iso8859-1"), "UTF-8");
		}
		try {
			// clearbean=1 清空session
			if (this.clearbean != null && this.clearbean == 1) {
				this.setSessionAttr("searchBean", null);
			} else {
				if (asset != null) {
					this.setSessionAttr("searchBean", asset);
				} else {
					asset = this.getSessionAttr("searchBean", null);
				}
			}
			if (asset == null) {
				asset = new Asset();
				asset.setAstMark("Q");
			} else {
				asset.setAstMark("Q");
			}
			if (this.pagination == null) {
				pagination = new Pagination();
			}
			pagination = this.assetCarService.findAstFinByExample(pagination,asset,astRange,deptNo);
			pagination.setUrl("/swss" + this.getRequest().getServletPath());
			if (this.pagination.getRowcount() == 0)
				this.msg = "无满足条件的记录";
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return INPUT;
		}
		return "resFinAduit";
	}

	public AssetCarService getAssetCarService() {
		return assetCarService;
	}

	public void setAssetCarService(AssetCarService assetCarService) {
		this.assetCarService = assetCarService;
	}

	public AstRange getAstRange() {
		return astRange;
	}

	public void setAstRange(AstRange astRange) {
		this.astRange = astRange;
	}
	
}
